package sicnu.cs.aps.common.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;

import java.util.HashMap;
import java.util.Map;

/**
 * @author CaiKe
 * @date 2022/5/27 14:17
 */
public enum ActivityAuditEnum implements BaseEnum {
    /**
     * 未知
     */
    UNKNOWN(0),
    /**
     * 通过
     */
    PASS(1),
    /**
     * 驳回
     */
    REBUT(2),
    /**
     * 拒绝
     */
    REJECT(3),
    /**
     * 创建
     */
    CREATE(4);

    Integer type;


    ActivityAuditEnum(Integer type) {
        this.type = type;
    }

    @Override
    public int getIndex() {
        return this.type;
    }

    ActivityAuditEnum() {
    }


    private static final Map<Integer, ActivityAuditEnum> MAP = new HashMap<>();

    static {
        for (ActivityAuditEnum auditEnum : values()) {
            MAP.put(auditEnum.type, auditEnum);
        }
    }

    public static ActivityAuditEnum getEnum(Integer type) {
        return MAP.get(type);
    }
}
